

#ifndef _BSP_I2C_H_
#define _BSP_I2C_H_

#include <stm32f4xx_hal.h>

/* INA226 I2C */
#define SENSOR_I2C I2C1
#define SENSOR_I2C_GROUP GPIOB
#define SENSOR_I2C_SCL_PIN GPIO_PIN_6
#define SENSOR_I2C_SDA_PIN GPIO_PIN_7
#define SENSOR_I2C_AF GPIO_AF4_I2C1
#define SENSOR_I2C_CLK_SPEED 100000 /* 100k */
#define SENSOR_I2C_MASTER_ADDR 0x08

#define SENSOR_I2C_GPIO_RCC_EN __HAL_RCC_GPIOB_CLK_ENABLE
#define SENSOR_I2C_RCC_EN __HAL_RCC_I2C1_CLK_ENABLE

int bsp_sensor_i2c_init(void);
I2C_HandleTypeDef* bsp_sensor_i2c_handle(void);

#endif